package com.iretailer.report.mapper;


import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.iretailer.report.base.SuperMapper;
import com.iretailer.report.model.CameraZone;
import com.iretailer.report.model.CameraZoneCamera;
import com.iretailer.report.model.CameraZoneMd;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * @Auther: xjw
 * @Date: 2019/1/21 11:36
 * @Description:
 */
public interface CameraZoneMapper extends SuperMapper<CameraZone> {

    /**
     * 返回的结果中包含  DeviceId ,DeviceName,MallId
     */
    List<CameraZoneCamera> selectCameraZoneByEnabled_MallId(@Param("enabled") Integer enabled, @Param("mallId") String mallId);

    List<CameraZoneCamera> selectCameraZoneByMallId_ZoneClass_Enable(@Param("mallId") String mallId, @Param("zoneClass") String zoneClass, @Param("enabled") Integer enabled);

    /**
     * 返回的结果中包含  DeviceId ,DeviceName,MallId ,MallName
     */
    List<CameraZone> selectCameraZoneByEnabled(@Param("enabled") Integer enabled);

    List<CameraZone> selectCameraZoneByEnabled_MallIds(Map<String, Object> map);

    /**
     * 返回的结果中包含  DeviceId ,DeviceName,MallId
     */
    List<CameraZoneCamera> selectCameraByDeviceId(@Param("deviceId") String deviceId);

    /**
     * 返回的结果中包含  Dreverse,PhysicalzonesId ,DeviceId,DeviceName,MallId
     */
    List<CameraZoneCamera> selectCameraZoneByEnabled_PhysicalZoneId(@Param("enabled") Integer enabled, @Param("physicalZoneId") Long physicalZoneId);

    List<CameraZoneCamera> selectByEnabled_PhysicalZoneIds(@Param("enabled") Integer enabled, @Param("physicalZoneIds") List<Long> physicalZoneIds);

    IPage<CameraZoneMd> selectPageCameraZone(Page page, @Param("ew") QueryWrapper queryWrapper);

    IPage<CameraZoneMd> selectPageUserCameraZone(Page page, @Param("ew") QueryWrapper queryWrapper);

    List<CameraZoneMd>  selectCameraZone(@Param("ew") QueryWrapper queryWrapper);

    List<CameraZoneMd>  selectUserCameraZone(@Param("ew") QueryWrapper queryWrapper);
}
